package com.biscuit.page.basicservice.remote.api;

import com.biscuit.common.base.BaseListResponse;
import com.biscuit.page.basicservice.api.ICollectionRemote;
import com.biscuit.common.base.BaseResponse;
import com.biscuit.common.base.BaseResponseVoid;
import com.biscuit.page.basicservice.api.model.request.collection.CollectionSaveAReq;
import com.biscuit.page.basicservice.api.model.response.collection.CollectionAResp;
import com.biscuit.page.basicservice.api.model.response.collection.CollectionSaveAResp;
import com.biscuit.page.basicservice.api.model.response.collection.DefaultCollectionRefreshStatusAResp;
import com.biscuit.page.basicservice.service.CollectionService;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author mazihao
 * @createTime 2024/3/26 9:32
 */
@RestController
public class CollectionRemoteImpl implements ICollectionRemote {

    @Resource
    private CollectionService collectionService;

    @Override
    public BaseResponse<BaseListResponse<CollectionAResp>> getCollectionList() {
        return collectionService.getCollectionList();
    }

    @Override
    public BaseResponse<CollectionSaveAResp> saveCollection(CollectionSaveAReq req) {
        return this.collectionService.saveCollection(req);
    }

    @Override
    public BaseResponse<BaseResponseVoid> delCollectionById(Long id) {
        return this.collectionService.delCollectionById(id);
    }

    @Override
    public BaseResponse<BaseResponseVoid> saveDefaultCollection(CollectionSaveAReq req) {
        return this.collectionService.saveDefaultCollection(req);
    }

    @Override
    public BaseResponse<BaseResponseVoid> delDefaultCollectionById(String id) {
        return this.collectionService.delDefaultCollectionById(id);
    }

    @Override
    public BaseResponse<DefaultCollectionRefreshStatusAResp> getDefaultCollectionRefreshStatus() {
        return this.collectionService.getDefaultCollectionUpdateStatus();
    }

}
